package com.gxa.learning.portal;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.oas.annotations.EnableOpenApi;
import tk.mybatis.spring.annotation.MapperScan;

/**
 *
 *
 * @author YXQ
 * @date 2021/12/1 0:01
 */
@SpringBootApplication
@MapperScan(value = "com.gxa.learning.portal.mapper")
@EnableOpenApi
@EnableScheduling
public class PortalMainApp extends SpringBootServletInitializer {
    /**
     * springboot的启动方式是jar,所以主入口不再是启动tomcat
     * spring启动的时候都做了哪些事
     * jar需要main方式启动
     * 在main中告诉springboot中加载类
     *
     * @param args 参数
     */
    public static void main(String[] args) {
        SpringApplication.run(PortalMainApp.class, args);
    }

    @Override
    public SpringApplicationBuilder configure(SpringApplicationBuilder
                                                      application) {
        return application.sources(PortalMainApp.class);
    }
}